package com.example.seataone.service.impl;

import com.example.seataone.feign.TwoFeign;
import com.example.seataone.mapper.OneMapper;
import com.example.seataone.service.OneService;
import io.seata.spring.annotation.GlobalTransactional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class OneServiceImpl implements OneService {

    @Autowired
    private TwoFeign twoFeign;
    @Autowired
    private OneMapper oneMapper;

    @GlobalTransactional
    @Override
    public void hello() {
        oneMapper.insert("hello");
        twoFeign.hello();
        // int i = 0 / 0;
    }
}
